﻿using System;
using System.Data;
using System.IO;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Net对Xml文件的操作 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    
        DataSet myDS = new DataSet();
        DataTable myTable = new DataTable("table1");
        myTable.Columns.Add("col1", typeof(string));
        myDS.Tables.Add(myTable);

        string xmlData = "<XmlDS><table1><col1>Value1</col1></table1><table1><col1>Value2</col1></table1></XmlDS>";

        StringReader xmlSR = new StringReader(xmlData);

        myDS.ReadXml(xmlSR, XmlReadMode.IgnoreSchema);
        myDS.WriteXml(Server.MapPath("TestFile.Xml"), XmlWriteMode.WriteSchema);

    }


}
